package com.skyworthclub.competition.utils.service;

import org.springframework.security.crypto.factory.PasswordEncoderFactories;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.stereotype.Component;

/**
 * @author li
 * @version 1.0
 * @since 18-10-15 下午8:44
 * 密码加密工具，需要与Spring security 配置保持一致
 **/
@Component
public class PasswordEncoderUtil {
    public static String passwordEncode(String rawPassword) {
        PasswordEncoder passwordEncoder = PasswordEncoderFactories.createDelegatingPasswordEncoder();
        return passwordEncoder.encode(rawPassword);
    }
}
